#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 998244853;
typedef long long LL;
const int N = 2e6 + 10;

void solve() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int ans = 0;
    for(int i = 0; i < s.size(); i ++)
    {
        if(s[i] == '0') ans ++;
        else 
        {
            if(ans == 1)
            {
                cout << "No" << endl;
                return;
            }
            ans = 0;
        }
    }
    if(ans == 1)
    {
        cout << "No" << endl;
        return;
    }
    
    cout << "Yes" << endl;
    s = ' ' + s;
    int last = 0;
    ans = 0;
    for(int i = 1; i < s.size(); i ++)
    {
        last ++;
        if(s[i] == '0') ans ++;
        else 
        {
            int tt = last;

            while(ans)
            {
                ans --;
                cout << tt - 1 << ' ';
                tt --;
            }
            cout << last << ' ';
        }
    }
    int tt = last + 1;
    while(ans)
    {
        ans --;
        cout << tt - 1 << ' ';
        tt --;
    }
    cout << endl;
}
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
}
/*
function find(int x):    
l := 1    
r := n    
while l <= r:        
let m be a random integer between l and r,inclusive        
if p[m] == x            
return m       
if p[m] > x:            
    r := m - 1        
else:            
    l := m + 1    
return undefined     // not found
 */